package net.pugsplace.gpremacy.state;

import java.io.Serializable;
import java.util.Collection;
import java.util.Vector;

import net.pugsplace.gpremacy.rules.Corporation;

public class Industry implements Serializable {
	private static final long serialVersionUID = 5735780216204897049L;
	
	Collection<Corporation> operating;
	Collection<Corporation> idle;
	
	public Industry() {
		operating = new Vector<Corporation>();
		idle = new Vector<Corporation>();
	}
	
	public Collection<Corporation> getOperatingCorporations() {
		return new Vector<Corporation>(operating);
	}
	
	public Collection<Corporation> getIdleCorporations() {
		return new Vector<Corporation>(idle);
	}
	
	public void beginOperating(Corporation c) {
		assert idle.contains(c);
		idle.remove(c);
		operating.add(c);
	}
	
	public void beginIdling(Corporation c) {
		assert operating.contains(c);
		operating.remove(c);
		idle.add(c);
	}
	
	public void addIdleCorporation(Corporation c) {
		idle.add(c);
	}
}
